package cn.com.edaily.auth.utils;

import java.util.UUID;

/**
 * <pre>类名: UuidUtil</pre>
 * <pre>描述: 随机字符串生成器</pre>
 * <pre>版权: web_chen@163.com</pre>
 * <pre>日期: 2020/1/31 14:10</pre>
 * <pre>作者: chenwb</pre>
 */
public class UuidUtil {

	/**
	 * @return String
	 * @Description: 生成不带-的uuid字符串
	 * @author chenwb
	 * @date 2020/1/31 14:11
	 */
	public static String generateUuid() {
		return UUID.randomUUID().toString().replaceAll("-", "");
	}

	/**
	 * @return String
	 * @Description: 生成定长不带-的uuid字符串
	 * @author chenwb
	 * @date 2020/1/31 14:11
	 */
	public static String generateUuid(Integer size) {
		return UUID.randomUUID().toString().replaceAll("-", "").substring(0, size);
	}
}
